package com.yunbao.core.springmvc.exception;

import com.yunbao.core.respones.Result;
import com.yunbao.core.respones.ResultBuilder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局捕获异常
 *
 * @author keriezhang
 * @date 2016/10/31
 */
@Slf4j
//@RestControllerAdvice
public class ExceptionHandle {


    @ExceptionHandler(value = Exception.class)
    public Result handle(Exception e) {
        return ResultBuilder.errorInfo(500,e.getMessage());
    }
}
